import React from 'react'
import Link from 'next/link'

class AuthFooter extends React.Component {
    render() {
        return (
            <footer>
                {this.props.list.map((value, key) => {
                    let str = ''
                    if (value === 'index') {
                        str = '首页'
                    } else if (value === 'login') {
                        str = '登录'
                    } else if (value === 'register') {
                        str = '注册'
                    }
                    return (
                        <Link href={"/" + value} key={key} prefetch>
                            <a>{str}</a>
                        </Link>
                    )
                })}
                <style jsx>{`
                    footer {
                        margin: 3px 0 0 0;
                    }
                    footer a:nth-child(1) {
                        float: left;
                    }
                    footer a:nth-child(2) {
                        float: right;
                    }
                `}</style>
            </footer>
        )
    }
}

export default AuthFooter